Repository navigation
Fix inverted command checks - #60
Merged
Merged
Conversation
Both conditions were negated relative to BWAPI's Templates.h: every command to a morphing egg was rejected as Incompatible_State, and cancelling a building under construction was rejected as Incompatible_UnitType. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017rQK8yo5j7dzMXzqMnUuGm
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017rQK8yo5j7dzMXzqMnUuGm
has_power converted the tile size to pixels and then multiplied by 16, so the checked point lay size x 512 pixels away and every building that needs power failed can_build_here. BWAPI uses tile size x 16. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017rQK8yo5j7dzMXzqMnUuGm
build_addon sent a Build command, can_research denied available tech and completed buildings, and can_make rejected a builder carrying the required addon, so no tech was researched and no tank was trained. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017rQK8yo5j7dzMXzqMnUuGm
The data tables skipped BWAPI's unused ids but were indexed by id, so upgrades from Argus_Jewel on read another row or panicked (Chitinous Plating read None's row), and TechType::None and Nuclear_Strike panicked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017rQK8yo5j7dzMXzqMnUuGm
Both targets sent the untargeted Use_Tech command, so Psionic Storm, Scanner Sweep, the Archon merge and every other targeted spell failed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017rQK8yo5j7dzMXzqMnUuGm
can_cloak refused unless the unit was already cloaked, the opposite of BWAPI's check, so no unit could ever cloak. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017rQK8yo5j7dzMXzqMnUuGm
The Dark Archon Meld check rejected targets owned by the caster, the opposite of BWAPI's check, so no Dark Archon could be made. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017rQK8yo5j7dzMXzqMnUuGm
The research check applied only to Lurkers, the opposite of BWAPI's, so unresearched spells passed the check and the game ignored the command. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017rQK8yo5j7dzMXzqMnUuGm
can_use_tech_unit skipped the tech's own checks (research, energy), so an unresearched Mind Control passed and the game ignored it; the Burrowing check rejected the units that can burrow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017rQK8yo5j7dzMXzqMnUuGm
…ed building Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
unload_all(Some(pos)) sent Unload_All instead of Unload_All_Position. can_cancel_research and can_cancel_addon were inverted, CanBuild and CanUnloadAllPosition rejected a unit exactly when the command type was legal, and can_morph rejected an idle Hatchery, Lair or Hive without larva, so Lair and Hive could not be started then. All compared with BWAPI's Templates.h; tests run the checks on a synthetic game. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
can_build_here tested the blocking unit's own type for being an addon, so any SCV walking over a Command Center's addon spot refused the Comsat Station. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017rQK8yo5j7dzMXzqMnUuGm
Maps the shared memory via shm_open/mmap and talks to the server over its Unix socket. RSBWAPI_SERVER_PID connects to that server directly, without going through the game table. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.